package com.example.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Data
@Document(indexName = "first_elasticsearch1", type = "article1")
public class Article implements Serializable {

    @Id
    private String id;

    // 是否索引，就是看该列是否能被搜索
    // 是否分词，即使表示搜索的时候是整理匹配还是单词匹配
    // 是否存储，就是是否在页面上显示
    @Field(type = FieldType.Text, index = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String title;

    @Field(type = FieldType.Text, index = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String content;
    //    @Field(type = FieldType.Text)
    private String state;


}
